#ifndef NETSPEED_H
#define NETSPEED_H

#include <QDialog>
#include <QPoint>
#include <QVBoxLayout>
#include <QTimer>
#include <QFile>

#include <syslog.h>

#include "frame.h"
#include "utils.h"
#include "sysinfo.h"

#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>

class netspeed : public QDialog
{
    Q_OBJECT
public:
    netspeed(QDialog *parent = 0);

    /* Init Class Member */
    void init_member();

private:
    /* GUI */
    boost::shared_ptr<Frame> m_net_frame;
    boost::shared_ptr<SysInfo> m_info_frame;

    /* Dest Position */
    QPoint m_mouse_dest_pos;

    /* flush Timer */
    boost::shared_ptr<QTimer> m_timer;

    /* first cache netspeed data */
    bool read_ok;

    /* for lacation */
    QSize DesktopSize;

    /* Layout */
    boost::shared_ptr<QVBoxLayout> m_layout;

protected:
    void mousePressEvent(QMouseEvent *);

    void mouseMoveEvent(QMouseEvent *);

    void mouseReleaseEvent(QMouseEvent *);

    void paintEvent(QPaintEvent *);

private slots:
    void read_sysinfo();

    void close_win();

    void hide_change_size();

    void show_change_size();

private:
    bool set_app_stylesheet(QString filename);
};

#endif // NETSPEED_H
